package com.example.tiaociweb.Service;

import com.example.tiaociweb.entity.Ceramic;
import com.example.tiaociweb.Repository.CeramicRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CeramicService {

    @Autowired
    private CeramicRepository ceramicRepository;

    public List<Ceramic> findAll() {
        return ceramicRepository.findAll();
    }

    public Ceramic save(Ceramic ceramic) {
        return ceramicRepository.save(ceramic);
    }

    public Ceramic findById(Long id) {
        return ceramicRepository.findById(id).orElse(null);
    }

    public void deleteById(Long id) {
        ceramicRepository.deleteById(id);
    }
}